<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<title>快捷回复话术库</title>
	{$h->import('static/css/public.css')}
	<style type="text/css">
		body{
			background: #f5f5f5;
			padding-bottom: 60px;
		}
		.wetool_header_container{
			background: #fff;
		}
		.wetool_search_container{
			background: #fff;
		}
		.wetool_header_content{
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 10px 0 15px 0;
		}
		.wetool_header_content span{
			font-size: 14px;
			color: #606060;
			cursor: pointer;
		}
		.wetool_header_content img{
			height: 13px;
			width: 13px;
			margin: 0 20px;
		}
		.wetool_search_container{
			padding-bottom: 10px;
		}
		.wetool_search_content{
			padding:0 10px;
			display: flex;
			align-items: center;
			justify-content: center;
		}
		.wetool_search_content input{
			font-size: 14px;
			color: #666;
			text-align: center;
			height: 35px;
			line-height: 35px;
			padding:0 30px;
			border-radius: 22px;
			border: 1px solid #e8e8e8;
			background: #f9f9f9;
			flex: 1;
		}
		.wetool_main_container{
			background: #f5f5f5;
			padding: 10px;
		}
		.wetool_main_content{

		}
		.wetool_main_content li{
			background: #fff;
			border: 1px solid #eaeaea;
			margin-bottom: 10px;
			border-radius: 5px;
			overflow: hidden;
		}
		.wetool_ListTitle_container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 8px 15px;
			border-bottom: 1px solid #eaeaea;
		}
		.wetool_ListTitle_container span{
			font-size: 14px;
			font-weight: bold;
			color: #333;
		}
		.wetool_ListTitle_container img{
			width: 26px;
			height: 26px;
			cursor: pointer;
		}
		.wetool_ListMain_container{
			padding: 15px;
		}
		.wetool_ListLink_container{
			border: 1px solid #eaeaea;
			padding: 15px;
			border-radius: 3px;
			max-width: 200px;
		}
		.wetool_ListLink_container h3{
			font-size: 14px;
			font-weight: bold;
			color: #666;
		}
		.wetool_ListLink_content{
			display: flex;
			/*align-items: center;*/
		}
		.wetool_ListLink_content p{
			font-size: 14px;
			color: #999;
			flex: 1
		}
		.wetool_ListLink_content img{
			width: 44px;
			height: 44px;
		}
		.wetool_ListImg_container{

		}
		.wetool_ListImg_container img{
			width: 73px;
			height: 73px;
			display: block;
		}
		.wetool_ListText_container{

		}
		.wetool_ListText_container p{
			color: #666;
			font-size: 14px;
		}
		.wetool_ListVideo_container{
			position: relative;
			max-width: 200px;
		}
		.wetool_ListVideo_container img:first-child{
			width: 100%;
			display: block;
		}
		.wetool_ListVideo_container img:last-child{
			position: absolute; 
			left: 50%; 
			top: 50%;
			transform: translate(-50%, -50%);
			width: 50px;
			height: 50px;
		}
		.wetool_ListFile_container{
			display: flex;
			border: 1px solid #eaeaea;
			padding: 15px;
			border-radius: 3px;
			max-width: 200px;
		}
		.wetool_ListFile_container img{
			height: 44px;
			widows: 44px;
			display: block;
		}
		.wetool_ListFile_content{
			flex: 1
		}
		.wetool_ListFile_content h3{
			font-size: 14px;
			font-weight: bold;
			color: #666;
		}
		.wetool_ListFile_content p{
			font-size: 14px;
			color: #999;
		}
		.loadMore_container{
			display: flex;
			justify-content: center;
			align-items: center;
			/*padding-bottom: 20px;*/
		}
		.loadMore_container span{
			background: #3375e8;
			border-radius: 5px;
			padding:8px 10px;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #fff;
			font-size: 14px;
			cursor: pointer;
		}
		/*------------分页部分--------------*/
		.main-container-h{
			padding: 0 40px 20px 40px;
		}
		.pageing-container-h{
			display: flex;
			justify-content: space-between;
		}
		.pageing-content-h{
			line-height: 28px;
		}
		.pageing-content-h a{
			border: 1px solid #e2e2e2;
			padding: 4px 15px;
			color: #333;
			line-height: 28px;
			border-radius: 2px;
		}
		.current{
			background: #1E9FFF !important;
			color: #fff !important;
		}
		/*lable and classify*/
		.wetool_lable_container{
			padding: 10px 5px 0 5px;
		}
		.wetool_lable_content{
			display: flex;
			align-items: center;
			flex-wrap: wrap;
		}
		.wetool_lable_content li{
			border: 1px solid #999;
			margin: 5px 8px;
			padding: 2px 10px;
			font-size: 14px;
			border-radius: 2px;
			color: #999;
			cursor: pointer;
		}
		.wetoolLableActive{
			border: 1px solid #3889ff !important;
			color: #3889ff !important;
		}
		.wetool_classify_container{
			background: #fff;
			margin-top: 10px;
		}
		.wetool_classify_content{
			display: flex;
			align-items: center;
		}
		.wetool_classify_content li{
			flex: 1;
			color: #666;
			border-bottom: 1px solid #fff;
			text-align: center;
			padding: 10px 0;
			font-size: 14px;
			cursor: pointer;
		}
		.wetoolClassifyActive{
			color: #3889ff !important;
			border-bottom: 1px solid #3889ff !important;
		}
		/*折叠*/
		.a-text { 
			font-size: 15px;
			color: #3598ff;
			cursor: pointer;
		}
		.a-text:hover { 
			color: red;
		}
		.flod_firstText {
			font-size: 15px;
			color: #0a001f;
		}
		.fold_textStyle { 
			font-size: 15px;
			color: #0a001f;
			display: none;  
		}
		/*底部导航*/
		.footer_nav_container{
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			/*border-top: 1px solid #ececec;*/
			box-shadow: 0px 0px 3px #ececec;
			background: #fff;
		}
		.footer_nav_container{
			display: flex;
			align-items: center;
		}
		.footer_nav_container li{
			flex: 1;
			padding: 10px 0;
			list-style: none;
		}
		.footer_nav_container a{
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
		}
		.footer_nav_container li svg{
			width: 16px;
			height: 16px;
			margin-bottom: 3px;
		}
		.footer_nav_container li span{
			font-size: 12px;
			color: #5a5a5a;
		}
		/*版权信息*/
		.public_copyright_container{
			
		}
		.public_copyright_content{
			position: relative;
			margin: 30px 30px 60px 30px;
			display: flex;
			justify-content: center;
			align-items: center;
			background: url(http://weidogstest.oss-cn-beijing.aliyuncs.com/0d118b616ad13e1f874e458c8310be76.png)no-repeat center center;
		}
		.public_copyright_content p{
			background: #f5f5f5;
			font-size: 13px;
			color: #999;
			line-height: 17px;
			text-align: center;
			padding: 0 5px;
		}
	</style>
</head>
<body>
	<div class="wetool_header_container">
		<div class="wetool_header_content">
			<span id="titleShow">按标题展示</span>
			<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/7380d9861c8ff157d4244372dc8a2eb3.png">
			<span id="contentShow" style="color: #3375e8">按内容展示</span>
		</div>
	</div>
	<div class="wetool_search_container">
		<div class="wetool_search_content">
			<input type="text" name="name" id="name" value="{$name}" placeholder="请输入标题进行搜索" oninput="search()">
		</div>
		<!-- lable -->
		<div class="wetool_lable_container">
			<ul class="wetool_lable_content">
				<li {if !$groupid}class="wetoolLableActive"{/if} onclick="select_group(0)">全部</li>
				{loop $grouparr as $id=>$name}
					<li {if $groupid == $id}class="wetoolLableActive"{/if} onclick="select_group('{$id}')">{$name}</li>
				{/loop}
			</ul>
		</div>
	</div>
	<!-- classify -->
	<div class="wetool_classify_container">
		<ul class="wetool_classify_content">
			<li {if !$type}class="wetoolClassifyActive"{/if}  onclick="select_type(0)">全部</li>
			<li {if $type == 1}class="wetoolClassifyActive"{/if} onclick="select_type(1)">文本</li>
			<li {if $type == 2}class="wetoolClassifyActive"{/if} onclick="select_type(2)">图片</li>
			<li {if $type == 3}class="wetoolClassifyActive"{/if} onclick="select_type(3)">视频</li>
			<li {if $type == 4}class="wetoolClassifyActive"{/if} onclick="select_type(4)">文件</li>
			<li {if $type == 5}class="wetoolClassifyActive"{/if} onclick="select_type(5)">链接</li>
			<li {if $type == 6}class="wetoolClassifyActive"{/if} onclick="select_type(6)">图文</li>
		</ul>
	</div>
	<div class="wetool_main_container">
		<ul class="wetool_main_content" id="showData">
			{loop $res as $r}
				{if $r->type == 1}
					<!-- 文本 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListText_container">
								<p data-id="{$r->id}" class="p{$r->id} flod_firstText tt1">{$r->text_content}</p>
							</div>
						</div>
					</li>
				{elseif $r->type == 2}
					<!-- 图片 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListImg_container">
								<img src="{$r->pic_path}">
							</div>
						</div>
					</li>
				{elseif $r->type == 3}
					<!-- 视频 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListVideo_container">
								<span>{$r->video_name}</span>
								<!-- 视频封面图  不要颠倒顺序！！！-->
								<!--<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/baed8e1de70768f00498c7d6590024e4.png">-->
								<!-- 播放图片 不要颠倒顺序！！！-->
								<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/46ae6c9a872bab739ecc0d41c6e17fa9.png">
							</div>
						</div>
					</li>
				{elseif $r->type == 4}
					<!-- 文件 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListFile_container">
								<div class="wetool_ListFile_content">
									<h3>{$r->file_name}</h3>
									<!--<p>测试文件描述</p>-->
								</div>
								<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/ee1ffa4ea0d9140d4ab58827ef362475.png">
							</div>
						</div>
					</li>
				{elseif $r->type == 5}
					<!-- 链接 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListLink_container">
								<h3>{$r->link_title}</h3>
								<div class="wetool_ListLink_content">
									<p>{$r->link_desc}</p>
									<img src="{$r->link_pic}">
								</div>
							</div>
						</div>
					</li>
				{elseif $r->type == 6}
					<!-- 图文 -->
					<li>
						<div class="wetool_ListTitle_container">
							<span>{$r->name}</span>
							<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage({$r->id})">
						</div>
						<div class="wetool_ListMain_container">
							<div class="wetool_ListImg_container">
								文字：{$r->characters}
							</div>
							<div class="wetool_ListImg_container">
								<img src="{$r->drawing}">
							</div>
						</div>
					</li>
				{/if}
			{/loop}
		</ul>
	</div>
	<div class="loadMore_container">
		<input type="hidden" id="pageIndex" value="2"/>
		<span onclick="load_more()">加载更多</span>
	</div>
	<!-- <div class="main-container-h pageing-container-h">
		       <div class="pageing-content-h">
		           <span>{$p->totalnum}条/{$p->totalpage}页</span> 
		        </div>
				<ul class="pageing-content-h">
		           {P weidogsadmin}
				</ul> -->
	</div>
	<!-- 版权 -->
	<div class="public_copyright_container">
		<div class="public_copyright_content">
			<p>{$copyright}</p>
		</div>
	</div>
	<div class="footer_nav_container">
		<ul class="footer_nav_container">
			<li>
				<a href="#">
					<svg fill="#3787f6" t="1604937091238" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5844" width="50" height="50"><path d="M314.785185 440.888889m-49.777778 0a49.777778 49.777778 0 1 0 99.555556 0 49.777778 49.777778 0 1 0-99.555556 0Z" p-id="5845"></path><path d="M512.474074 440.888889m-49.777778 0a49.777778 49.777778 0 1 0 99.555556 0 49.777778 49.777778 0 1 0-99.555556 0Z" p-id="5846"></path><path d="M708.740741 440.888889m-49.777778 0a49.777778 49.777778 0 1 0 99.555556 0 49.777778 49.777778 0 1 0-99.555556 0Z" p-id="5847"></path><path d="M512.474074 897.896296c-7.68 0-14.885926-3.792593-19.152593-10.145185l-90.074074-132.077037H192c-36.314074 0-65.896296-29.582222-65.896296-65.896296v-497.777778c0-36.314074 29.582222-65.896296 65.896296-65.896296h640c36.314074 0 65.896296 29.582222 65.896296 65.896296v497.777778c0 36.314074-29.582222 65.896296-65.896296 65.896296H621.700741l-90.074074 132.077037c-4.266667 6.352593-11.472593 10.145185-19.152593 10.145185z m-320.474074-725.333333c-10.714074 0-19.437037 8.722963-19.437037 19.437037v497.777778c0 10.714074 8.722963 19.437037 19.437037 19.437037h223.478519c7.68 0 14.885926 3.792593 19.152592 10.145185l77.842963 114.157037 77.842963-114.157037c4.361481-6.352593 11.472593-10.145185 19.152593-10.145185h222.53037c10.714074 0 19.437037-8.722963 19.437037-19.437037v-497.777778c0-10.714074-8.722963-19.437037-19.437037-19.437037h-640z" p-id="5848"></path></svg>
					<span style="color: #3787f6;">话术</span>
				</a>
			</li>
			<li>
			  <a href="/Addons/Materiallibrary/H5/Material/material.html?corp_id={$corp_id}&agent_id={$agent_id}">
			    <svg t="1611905721236" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5229" width="16" height="16"><path d="M408 536c44.8 0 80 35.2 80 80v208c0 44.8-35.2 80-80 80h-208c-44.8 0-80-35.2-80-80v-208c0-44.8 35.2-80 80-80h208z m400 0c44.8 0 80 35.2 80 80v208c0 44.8-35.2 80-80 80h-208c-44.8 0-80-35.2-80-80v-208c0-44.8 35.2-80 80-80h208z m-400 32h-208c-27.2 0-48 20.8-48 48v208c0 27.2 20.8 48 48 48h208c27.2 0 48-20.8 48-48v-208c0-27.2-20.8-48-48-48z m400 0h-208c-27.2 0-48 20.8-48 48v208c0 27.2 20.8 48 48 48h208c27.2 0 48-20.8 48-48v-208c0-27.2-20.8-48-48-48z m-398.4-432c43.2 0 78.4 35.2 78.4 78.4v211.2c0 43.2-35.2 78.4-78.4 78.4H198.4c-43.2 0-78.4-35.2-78.4-78.4V214.4c0-43.2 35.2-78.4 78.4-78.4h211.2z m0 32H198.4c-25.6 0-46.4 20.8-46.4 46.4v211.2c0 25.6 20.8 46.4 46.4 46.4h211.2c25.6 0 46.4-20.8 46.4-46.4V214.4c0-25.6-20.8-46.4-46.4-46.4z" fill="#5a5a5a" p-id="5230"></path><path d="M752 144l112 112c30.4 30.4 30.4 81.6 0 112l-112 112c-30.4 30.4-81.6 30.4-112 0l-112-112c-30.4-30.4-30.4-81.6 0-112l112-112c30.4-32 81.6-32 112 0z m-22.4 22.4c-19.2-19.2-48-19.2-67.2 0l-112 112c-19.2 19.2-19.2 48 0 67.2l112 112c19.2 19.2 48 19.2 67.2 0l112-112c19.2-19.2 19.2-48 0-67.2l-112-112z" fill="#5a5a5a" p-id="5231"></path></svg>
			    <span>素材</span>
			  </a>
			</li>
			<li>
				<a href="radar.html?corp_id={$corp_id}&agent_id={$agent_id}">
					<svg fill="#5a5a5a" t="1604937212716" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10541" width="50" height="50"><path d="M379.73333333333335 287.5733333333334h-55.14666666666667v55.14666666666667H379.73333333333335v-55.14666666666667z m348.9066666666667 257.17333333333335H802.1333333333333v-73.49333333333334h-73.49333333333334v73.49333333333334zM508.26666666666665 105.7066666666667c-221.86666666666667 0-402.34666666666664 180.48-402.34666666666664 402.24s180.48 402.24 402.34666666666664 402.24c221.76 0 402.24-180.48 402.24-402.24S730.0266666666666 105.7066666666667 508.26666666666665 105.7066666666667z m-18.346666666666664 770.88c-188.90666666666667-9.28-340.9066666666667-161.27999999999997-350.2933333333333-350.2933333333333h112.21333333333334c8.96 127.36 110.72 229.12 238.07999999999998 238.07999999999998v112.21333333333334z m0-130.56c-117.22666666666667-8.96-210.7733333333333-102.50666666666666-219.73333333333332-219.73333333333332h129.38666666666666c7.786666666666666 46.18666666666666 44.16 82.56 90.34666666666666 90.34666666666666v129.38666666666666z m0-166.93333333333334c-25.813333333333333-6.613333333333333-46.18666666666666-26.986666666666668-52.8-52.8h52.8v52.8z m0-89.49333333333334h-52.8c6.613333333333333-25.813333333333333 26.986666666666668-46.18666666666666 52.8-52.8V489.6z m0-238.07999999999998c-32.64 2.3466666666666667-63.68 10.666666666666666-91.83999999999999 24.10666666666667v20.48c27.84-14.506666666666666 58.88-23.68 91.83999999999999-26.133333333333333v129.38666666666666c-46.18666666666666 7.786666666666666-82.56 44.16-90.34666666666666 90.34666666666666H270.1866666666667c3.6266666666666665-48.31999999999999 21.653333333333332-92.58666666666666 49.81333333333333-128.53333333333333h-22.826666666666664c-25.813333333333333 36.906666666666666-42.026666666666664 80.96000000000001-45.44 128.53333333333333H139.62666666666667c9.28-188.90666666666667 161.27999999999997-340.9066666666667 350.2933333333333-350.2933333333333v112.10666666666665z m36.69333333333333 185.27999999999997c25.813333333333333 6.613333333333333 46.18666666666666 26.986666666666668 52.8 52.8h-52.8v-52.8z m0 89.6h52.8c-6.613333333333333 25.813333333333333-26.986666666666668 46.18666666666666-52.8 52.8v-52.8z m0 350.18666666666667V764.48c114.88-8.106666666666666 208.85333333333335-91.62666666666667 232.85333333333335-201.38666666666668h-18.88c-23.466666666666665 99.52-109.33333333333333 174.93333333333334-213.97333333333333 182.93333333333334V616.64c46.18666666666666-7.786666666666666 82.56-44.16 90.34666666666666-90.34666666666666h93.33333333333333V489.6h-93.33333333333333c-7.786666666666666-46.18666666666666-44.16-82.56-90.34666666666666-90.34666666666666V269.97333333333336c104.63999999999999 8 190.50666666666666 83.41333333333334 213.97333333333333 182.93333333333334H759.4666666666667c-24-109.76-117.97333333333333-193.27999999999997-232.85333333333335-201.38666666666668V139.30666666666667C715.52 148.5866666666667 867.52 300.5866666666667 876.8 489.6h-56.42666666666666v36.69333333333333H876.8c-9.28 189.01333333333332-161.27999999999997 341.0133333333333-350.18666666666667 350.2933333333333z" p-id="10542"></path></svg>
					<span>雷达</span>
				</a>
			</li>
		</ul>
	</div>
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		function IsPC() {
		   var userAgentInfo = navigator.userAgent;
		   var Agents = ["Android", "iPhone",
		      "SymbianOS", "Windows Phone",
		      "iPad", "iPod"];
		   var flag = true;
		   for (var v = 0; v < Agents.length; v++) {
		      if (userAgentInfo.indexOf(Agents[v]) > 0) {
		         flag = false;
		         break;
		      }
		   }
		   return flag;
		}
		function load_more(){
			var wid = {$wid};
			var name = $('#name').val();
			var pageIndex = parseInt($('#pageIndex').val());
			//console.log(pageIndex);
			myAjaxPost(false, true, "load_more.html", { wid:wid,name:name,type:"{$type}",groupid:"{$groupid}",pageIndex:pageIndex}, function (resp) {
				var data = resp.data?resp.data:[];
				var html = '';
				for(i = 0; i < data.length; i++){
					if(data[i].type == 1){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListText_container">';
						html += '<p data-id='+data[i].id+' class="p'+data[i].id+' flod_firstText tt'+pageIndex+'">'+data[i].text_content+'</p>';
						html += '</div></div></li>';
					}else if(data[i].type == 2){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListImg_container">';
						html += '<img src="'+data[i].pic_path+'">';
						html += '</div></div></li>';					
					}else if(data[i].type == 3){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListVideo_container">';
						html += '<span>'+data[i].video_name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/46ae6c9a872bab739ecc0d41c6e17fa9.png">';
						html += '</div></div></li>';
					}else if(data[i].type == 4){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListFile_container">';
						html += '<div class="wetool_ListFile_content">';
						html += '<h3>'+data[i].file_name+'</h3>';
						html += '</div>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/ee1ffa4ea0d9140d4ab58827ef362475.png">';
						html += '</div></div></li>';
					}else if(data[i].type == 5){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListLink_container">';
						html += '<h3>'+data[i].link_title+'</h3>';
						html += '<div class="wetool_ListLink_content">';
						html += '<p>'+data[i].link_desc+'</p>';
						html += '<img src="'+data[i].link_pic+'">';
						html += '</div></div></div></li>';
					}else if(data[i].type == 6){
						html += '<li>';
						html += '<div class="wetool_ListTitle_container">';
						html += '<span>'+data[i].name+'</span>';
						html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
						html += '</div>';
						html += '<div class="wetool_ListMain_container">';
						html += '<div class="wetool_ListImg_container">文字：'+data[i].characters+'</div>';
						html += '<div class="wetool_ListImg_container">';
						html += '<img src="'+data[i].drawing+'">';
						html += '</div>';	
						html += '</div></li>';		
					}
				} 
				$('#showData').append(html);
				$('#pageIndex').val(pageIndex + 1);
				$(".tt"+pageIndex).each(function(j,item){
				    // 你要实现的业务逻辑
					var id = item.getAttribute("data-id");
					text_foled('.p'+id,id, 100);
				});
			});
		}
		
		// 搜索框失去焦点事件
		function search(){
			var wid = {$wid};
			var name = $('#name').val();
			var pageIndex = 1;
			// if(name){
			// 	location.href="Reply.html?corp_id={$corp_id}&agent_id={$agent_id}&name="+name;
			// }else{
			// 	location.href="Reply.html?corp_id={$corp_id}&agent_id={$agent_id}";
			// }
			if(name){
				myAjaxPost(false, true, "load_more.html", { wid:wid,name:name,type:"{$type}",groupid:"{$groupid}",pageIndex:pageIndex}, function (resp) {
					var data = resp.data?resp.data:[];
					var html = '';
					for(i = 0; i < data.length; i++){
						if(data[i].type == 1){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListText_container">';
							html += '<p data-id='+data[i].id+' class="p'+data[i].id+' flod_firstText tt'+pageIndex+'">'+data[i].text_content+'</p>';
							html += '</div></div></li>';
						}else if(data[i].type == 2){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListImg_container">';
							html += '<img src="'+data[i].pic_path+'">';
							html += '</div></div></li>';					
						}else if(data[i].type == 3){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListVideo_container">';
							html += '<span>'+data[i].video_name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/46ae6c9a872bab739ecc0d41c6e17fa9.png">';
							html += '</div></div></li>';
						}else if(data[i].type == 4){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListFile_container">';
							html += '<div class="wetool_ListFile_content">';
							html += '<h3>'+data[i].file_name+'</h3>';
							html += '</div>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/ee1ffa4ea0d9140d4ab58827ef362475.png">';
							html += '</div></div></li>';
						}else if(data[i].type == 5){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListLink_container">';
							html += '<h3>'+data[i].link_title+'</h3>';
							html += '<div class="wetool_ListLink_content">';
							html += '<p>'+data[i].link_desc+'</p>';
							html += '<img src="'+data[i].link_pic+'">';
							html += '</div></div></div></li>';
						}else if(data[i].type == 6){
							html += '<li>';
							html += '<div class="wetool_ListTitle_container">';
							html += '<span>'+data[i].name+'</span>';
							html += '<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/4118e13a5aaaa06bca8114dd3fdb864a.png" onclick="sendChatMessage('+data[i].id+')">';
							html += '</div>';
							html += '<div class="wetool_ListMain_container">';
							html += '<div class="wetool_ListImg_container">文字：'+data[i].characters+'</div>';
							html += '<div class="wetool_ListImg_container">';
							html += '<img src="'+data[i].drawing+'">';
							html += '</div>';	
							html += '</div></li>';			
						}
					}
					$("#showData").empty();
					$('#showData').append(html);
					$(".tt"+pageIndex).each(function(j,item){
					    // 你要实现的业务逻辑
						var id = item.getAttribute("data-id");
						text_foled('.p'+id,id, 100);
					});
				});
			}
		}
		
		function select_type(type){
			location.href="index.html?corp_id={$corp_id}&agent_id={$agent_id}&type="+type+"&groupid={$groupid}";
		}
		
		function select_group(groupid){
			location.href="index.html?corp_id={$corp_id}&agent_id={$agent_id}&groupid="+groupid+"&type={$type}";
		}
		
		// 点击头部展示
		$('#titleShow').on('click',function(){
			console.log('1');
			$('.wetool_ListMain_container').hide();
			$('.wetool_ListTitle_container').css('border-color','#fff');
			$('#contentShow').css('color','#606060');
			$(this).css('color','#3375e8');
		})
		$('#contentShow').on('click',function(){
			$('.wetool_ListMain_container').show();
			$('.wetool_ListTitle_container').css('border-color','#eaeaea');
			$('#titleShow').css('color','#606060');
			$(this).css('color','#3375e8');
		})
		// 标签
		$('.wetool_lable_content li').click(function(){
			$('.wetool_lable_content li').removeClass('wetoolLableActive');
			$(this).addClass('wetoolLableActive');
		})
		// 分类 wetool_classify_content
		$('.wetool_classify_content li').click(function(){
			$('.wetool_classify_content li').removeClass('wetoolClassifyActive');
			$(this).addClass('wetoolClassifyActive');
		})
	</script>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script>
		wx.config({
			beta: true,// 必须这么写，否则wx.invoke调用形式的jsapi会有问题
			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
			appId: "{$wxConfig['appId']}", // 必填，企业微信的corpID
			timestamp: "{$wxConfig['timestamp']}", // 必填，生成签名的时间戳
			nonceStr: "{$wxConfig['nonceStr']}", // 必填，生成签名的随机串
			signature: "{$wxConfig['signature']}",// 必填，签名，见 附录-JS-SDK使用权限签名算法
			jsApiList: ['sendChatMessage'] // 必填，需要使用的JS接口列表，凡是要调用的接口都需要传进来
		});
		wx.ready(function(){
			console.log('config success');
			wx.agentConfig({
				corpid: "{$corp_id}", // 必填，企业微信的corpid，必须与当前登录的企业一致
				agentid: "{$agent_id}", // 必填，企业微信的应用id （e.g. 1000247）
				timestamp: "{$agentConfig['timestamp']}", // 必填，生成签名的时间戳
				nonceStr: "{$agentConfig['nonceStr']}", // 必填，生成签名的随机串
				signature: "{$agentConfig['signature']}",// 必填，签名，见附录-JS-SDK使用权限签名算法
				jsApiList: ['selectExternalContact','sendChatMessage'], //必填
				success: function(res) {
					console.log('agentConfig success');
					wx.checkJsApi({
						jsApiList: ['sendChatMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
						success: function(res) {
							
						}
					});
				},
				fail: function(res) {
					if(res.errMsg.indexOf('function not exist') > -1){
						console.log('版本过低请升级')
					}
				}
			});
		});
		wx.error(function(res){
			console.log('error'+res);
		});
		
		function sendChatMessage(id){
			myAjaxPost(false, true, "get_reply_info-{$corp_id}-{$agent_id}.html", { id:id}, function (resp) {
				if (resp.status == 'success') {
					var is = IsPC();
					if(!is && resp.data.type == 6){
						tusi("该功能仅限于pc端使用");
						return false;
					}
					if(resp.data.type == 1){
						wx.invoke('sendChatMessage', {
							msgtype:"text", //消息类型，必填
							text: {
								content:resp.data.text_content, //文本内容
							}
						}, function(res) {
							//alert(res.err_msg);
							if (res.err_msg == 'sendChatMessage:ok') {
								console.log('发送成功');
							}
						})
					}else if(resp.data.type == 2){
						wx.invoke('sendChatMessage', {
							msgtype:"image", //消息类型，必填
							image: {
								mediaid:resp.data.media_id, 
							}
						}, function(res) {
							if (res.err_msg == 'sendChatMessage:ok') {
								//发送成功
							}
						})
					}else if(resp.data.type == 3){
						wx.invoke('sendChatMessage', {
							msgtype:"video", //消息类型，必填
							video: {
								mediaid:resp.data.media_id, 
							}
						}, function(res) {
							if (res.err_msg == 'sendChatMessage:ok') {
								//发送成功
							}
						})
					}else if(resp.data.type == 4){
						wx.invoke('sendChatMessage', {
							msgtype:"file", //消息类型，必填
							file: {
								mediaid:resp.data.media_id, 
							}
						}, function(res) {
							if (res.err_msg == 'sendChatMessage:ok') {
								//发送成功
							}
						})
					}else if(resp.data.type == 5){
						wx.invoke('sendChatMessage', {
							msgtype:"news", //消息类型，必填
							news: {
								link: resp.data.link_url, //H5消息页面url 必填
								title: resp.data.link_title, //H5消息标题
								desc: resp.data.link_desc, //H5消息摘要
								imgUrl: resp.data.link_pic, //H5消息封面图片URL
							}
						}, function(res) {
							if (res.err_msg == 'sendChatMessage:ok') {
								//发送成功
							}
						})
					}else if(resp.data.type == 6){
						wx.invoke('sendChatMessage', {
							msgtype:"text", //消息类型，必填
							text: {
								content:resp.data.characters, //文本内容
							}
						}, function(res) {
							//alert(res.err_msg);
							if (res.err_msg == 'sendChatMessage:ok') {
								wx.invoke('sendChatMessage', {
									msgtype:"image", //消息类型，必填
									image: {
										mediaid:resp.data.drawing, 
									}
								}, function(res) {
									if (res.err_msg == 'sendChatMessage:ok') {
										console.log('发送成功');
									}
								})
							}
						})
					}
				}else{
					tusi(resp.msg);
				}
			});
		}
	</script>
	<!-- 折叠文字 -->
	<script type="text/javascript">
		$(function () {
			$(".tt1").each(function(j,item){
			    // 你要实现的业务逻辑
				var id = item.getAttribute("data-id");
				text_foled('.p'+id,id, 100);
			});
		 	//var resNum = {count($res)} + 1;
		 	//for(var i = 1; i < resNum; i++){
		 	//	text_foled('.p'+i,i, 100);
		 	//}
		 });
		//$(function () {
		//    text_foled('.p1', 100);
		//});
		function text_foled(clas,i,num) {
		    var num = num;
		    var a = $("<a></a>").on('click', showText).addClass('a-text').text("【展开】");
		    var b = $("<a></a>").on('click', showText).addClass('a-text').text("【折叠】");
		    var p = $("<p></p>").addClass('fold_textStyle flod_text'+i);
		    var str = $(clas).text();
		    $(clas).after(p);
		    if (str.length > num) {
		        var text = str.substring(0, num) + "...";
		        $(clas).html(text).append(a);
		    }
		    $('.flod_text'+i).html(str).append(b);
		    function showText() {
		        $(this).parent().hide().siblings().show();
		    }
		}
	</script>

</body>
</html>